import { Controller, Get, UseGuards } from '@nestjs/common';
import {
  ApiTags,
  ApiOperation,
  ApiResponse,
  ApiBearerAuth,
} from '@nestjs/swagger';
import { UserService } from './user.service';
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';

@ApiTags('users')
@ApiBearerAuth('JWT-auth')
@Controller('users')
@UseGuards(JwtAuthGuard)
export class UserController {
  constructor(private readonly userService: UserService) {}

  @Get()
  @ApiOperation({
    summary: '获取所有用户',
    description: '获取系统中所有用户列表（用于任务分配）',
  })
  @ApiResponse({ status: 200, description: '成功获取用户列表' })
  @ApiResponse({ status: 401, description: '未授权' })
  findAll() {
    return this.userService.findAll();
  }
}
